import { SwaggerRouter } from 'koa-swagger-decorator';
import log from '../middleware/log'
import swaggerJson from './v1/swagger-json'
import path from 'path'

import ApiRouter from './v1';

const router = new SwaggerRouter();

router.use(log())
router.use('/api/v1', ApiRouter.routes());

// swagger docs avaliable at http://localhost:3000/swagger-html
router.swagger(swaggerJson);
router.mapDir(path.join(__dirname, '/v1'));

export default router;